package com.iris.live.services.common.reconsitution;

/**
 * yitianle(与数据库表pushapprovalworkflow属性type保持同步)
 * 审批流类型枚举
 * 2017/02/17
 */
public class ApprovalWorkFlowEnum {

    public static final int ORDER = 1;//订单
    public static final int ORDER_INTENTION = 2;//意向订单
    public static final int AGREEMENT = 3;//合同
    public static final int ORDER_RETREAT = 4;//订单退订
    public static final int ORDER_INTENTION_RETREAT = 5;//意向订单退订
    public static final int ORDER_UPDATE = 6;//订单修改
    public static final int ORDER_INTENTION_UPDATE = 7;//意向订单修改
    public static final int SHUNTING_IN = 8;//调车调入
    public static final int SHUNTING_OUT = 9;//调车调出
    public static final int AGREEMENT_UPDATE = 10;//合同修改
    public static final int AGREEMENT_RETREAT = 11;//合同退订
    public static final int TICKET_CHANG = 12;//换票
    public static final int TICKET_RETREAT = 13;//退票
    public static final int CHECK_SOURCE = 14;//车资确认
    public static final int CHECK_DEPOSIT = 15;//财务订金确认


    public static enum TYPE {
        ORDER("订单", ApprovalWorkFlowEnum.ORDER),
        ORDER_INTENTION("意向订单", ApprovalWorkFlowEnum.ORDER_INTENTION),
        AGREEMENT("合同", ApprovalWorkFlowEnum.AGREEMENT),
        ORDER_RETREAT("订单退订", ApprovalWorkFlowEnum.ORDER_RETREAT),
        ORDER_INTENTION_RETREAT("意向订单退订", ApprovalWorkFlowEnum.ORDER_INTENTION_RETREAT),
        ORDER_UPDATE("订单修改", ApprovalWorkFlowEnum.ORDER_UPDATE),
        ORDER_INTENTION_UPDATE("意向订单修改", ApprovalWorkFlowEnum.ORDER_INTENTION_UPDATE),
        SHUNTING_IN("调车调入", ApprovalWorkFlowEnum.SHUNTING_IN),
        SHUNTING_OUT("调车调出", ApprovalWorkFlowEnum.SHUNTING_OUT),
        AGREEMENT_UPDATE("合同修改", ApprovalWorkFlowEnum.AGREEMENT_UPDATE),
        AGREEMENT_RETREAT("合同退订", ApprovalWorkFlowEnum.AGREEMENT_RETREAT),
        TICKET_CHANG("换票", ApprovalWorkFlowEnum.TICKET_CHANG),
        TICKET_RETREAT("退票", ApprovalWorkFlowEnum.TICKET_RETREAT),
        CHECK_SOURCE("资源确认", ApprovalWorkFlowEnum.CHECK_SOURCE),
        CHECK_DEPOSIT("订金确认", ApprovalWorkFlowEnum.CHECK_DEPOSIT);

        private String name;
        private int index;

        // 构造方法
        private TYPE(String name, int index) {
            this.name = name;
            this.index = index;
        }

        // 普通方法
        public static String getName(int index) {
            for (TYPE c : TYPE.values()) {
                if (c.index == index) {
                    return c.name;
                }
            }
            return null;
        }
    }

}
